<?php
include("connect.php");
$ActID=$_REQUEST['ActID'];
$sql="SELECT ActName,ActCon,StartTime,EndTime,User.UserName,User.UserUrl FROM Activities,Contact,User WHERE Activities.ActID=Contact.ActID AND Activities.ActID='".$ActID."' AND Contact.UserID=User.UserID AND Contact.Identity=1";
mysqli_query($conn,"set names utf8mb4");
$result=mysqli_query($conn,$sql);
$data=Array();
class activity{
	public $ActName;
	public $ActCon;
	public $StartTime;
	public $EndTime;
        public $UserName;
        public $UserUrl;
}
while($row=mysqli_fetch_array($result,MYSQL_ASSOC)){
	$act=new activity();
	$act->ActName=urlencode($row["ActName"]);
	$act->ActCon=urlencode(str_replace('<br>','\n',$row["ActCon"]));
	$act->StartTime=urlencode($row["StartTime"]);
	$act->EndTime=urlencode($row["EndTime"]);
        $act->UserName=urlencode($row["UserName"]);
        $act->UserUrl=urlencode($row["UserUrl"]);
	$data[]=$act;
}


$json=json_encode($data);
echo urldecode($json);
?>